<template>
	<div class="cartoo-page">
		<el-tabs type="card" v-model="tab" @tab-click="changeTab($event.name)">
			<el-tab-pane
				:label="k.title + k.total"
				:name="k.title"
				v-for="k in tabs"
				:key="k.id"
			></el-tab-pane>
		</el-tabs>
		<div class="cartoo-wrap">
			<div
				:class="['cartoo-li', k.num % 5 === 0 && k.num !== k.total && 'active']"
				v-for="k in list"
				:key="k.link"
				@click="jumpLink(k.link)"
			>
				<img :src="k.cover" class="cartoo-img" />
				<p class="cartoo-title">{{ k.title }}</p>
				<p class="cartoo-num">更新至{{ k.num }}集 {{ k.num === k.total ? '已完结' : '' }}</p>
				<p class="cartoo-week">每周{{ k.week | getZhWeek }}更新</p>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			tabs: [
				{ type: 0, title: '全部', total: 0 },
				{ type: 1, title: '动画', total: 0 }
				// { type: 2, title: '动态漫', total: 0 }
			],
			tab: '全部',
			cartoos: [
				//
				{
					type: 1,
					title: '云深不知梦',
					link:
						'https://v.youku.com/v_show/id_XNjQ4ODQwNTc4MA==.html?spm=a2hja.12701310.filter.33&s=cfbd5ff48e464bbdb631&s=cfbd5ff48e464bbdb631',
					cover:
						'http://m.ykimg.com/05840000686884AF203CC71704B13A37?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [6],
					num: 6,
					total: 26,
					date: '2025/08/07'
				},
				{
					type: 1,
					title: '双生武魂',
					link: 'https://v.qq.com/x/cover/mzc00200advvuga/t4101qt8k62.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200advvuga1753269116521/350?imageView2/2/w/446/h/626',
					week: [3, 4],
					num: 14,
					total: 60,
					date: '2025/08/07'
				},
				{
					type: 1,
					title: '缥缈剑仙传',
					link: 'https://v.qq.com/x/cover/mzc00200cbdrkxt/p4101s1nu5i.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200hr21ari1753428305347/350?imageView2/2/w/446/h/626',
					week: [3, 0],
					num: 5,
					total: 40,
					date: '2025/08/07'
				},
				{
					type: 1,
					title: '万剑王座',
					link: 'https://v.qq.com/x/cover/mzc00200cbdrkxt/p4101s1nu5i.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200bf01uf81753429326330/350?imageView2/2/w/446/h/626',
					week: [1, 4],
					num: 6,
					total: 40,
					date: '2025/08/07'
				},
				{
					type: 1,
					title: '紫川 第2季',
					link: 'https://v.qq.com/x/cover/mzc00200cbdrkxt/p4101s1nu5i.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200cbdrkxt1754485545243/350?imageView2/2/w/446/h/626',
					week: [3],
					num: 4,
					total: 52,
					date: '2025/08/07'
				},
				{
					type: 1,
					title: '万古最强宗',
					link: 'https://v.qq.com/x/cover/mzc00200hmzibsu/n4100hz3ftf.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200hmzibsu1691472118694/350?imageView2/2/w/446/h/626',
					week: [3, 6],
					num: 9,
					total: 36,
					date: '2024/11/12'
				},
				{
					type: 1,
					title: '武逆',
					link: 'https://v.qq.com/x/cover/mzc00200ikyin32/t41001blmta.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200ikyin321730943809801/350?imageView2/2/w/446/h/626',
					week: [4],
					num: 26,
					total: 30,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '长生界',
					link: 'https://v.qq.com/x/cover/mzc00200kqa0dbi/r4100go6iiu.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200kqa0dbi1729388873524/350?imageView2/2/w/446/h/626',
					week: [2],
					num: 26,
					total: 26,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '凡人修仙传',
					link: 'https://www.bilibili.com/bangumi/play/ss28747?from_spmid=666.16.0.0',
					cover:
						'https://cdn.01lb.com.cn/images/nest/0aaa8560e96b8ead0ed653217dc0dd0f80ac03cf.png@320w_428h.webp',
					week: [6],
					num: 134,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '一念永恒',
					link: 'https://v.qq.com/x/cover/mzc002003lw1kp8/i4100b3rbvi.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc002003lw1kp81719464720304/0?max_age=7776000',
					week: [2],
					num: 41,
					total: 59,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '妖神记',
					link: 'https://v.qq.com/x/cover/yl6lapwmmx5ivew.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/yl6lapwmmx5ivew1752818757923/350?imageView2/2/w/223/h/313',
					week: [4, 6],
					num: 384,
					total: 432,
					date: '2025/07/23'
				},
				{
					type: 1,
					title: '绝世战魂',
					link:
						'https://www.iqiyi.com/v_d6xld6bdow.html?rseat=area_7&rpage=category_lib.4&block=pca_list_perview&position=1&hoverBlock=pca_list_perview&bstp=18&bkt=list_main,greeting_pca1_b,list_online&e=058d98ae027fa8da0725a5388232df5d&vfrm=category_lib.4&vfrmblk=pca_list_perview&vfrmrst=area_7',
					cover:
						'https://cdn.01lb.com.cn/images/nest/1716105646322_a_100558258_m_601_m9_318_424.webp',
					week: [2],
					num: 136,
					date: '2025/8/16'
				},
				{
					type: 1,
					title: '元尊',
					link: 'https://v.qq.com/x/cover/mzc00200sgiyvab.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200sgiyvab1716987069130/0?max_age=7776001',
					week: [4],
					num: 26,
					total: 26,
					date: '2024/6/12'
				},
				{
					type: 1,
					title: '剑域风云',
					link:
						'https://v.youku.com/v_nextstage/id_eacdafb09f604595bcb6.html?spm=a2hja.12701310.filter.45&s=eacdafb09f604595bcb6',
					cover:
						'http://m.ykimg.com/058400006523D545C847B70D6169DA1E?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [1, 4],
					num: 129,
					total: 196,
					date: '2024/03/02'
				},
				{
					type: 1,
					title: '眷思量',
					link: 'https://v.qq.com/x/cover/gehpfier9upkqz5/i0038won4fq.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/gehpfier9upkqz51691479043535/350?max_age=7776001',
					week: [3],
					num: 19,
					total: 30,
					date: '2024/06/12'
				},
				{
					type: 1,
					title: '万古神话',
					link:
						'https://www.iqiyi.com/v_27bc0jp2es4.html?vfrm=category_lib.4&vfrmblk=S:lib_1_video&vfrmrst=S:lib_1_video_float_video_area8&bkt=list_main%2Cgreeting_rank3_c%2Cfilter_d%2Cgreeting_rank4_e%2Ccategory_page_01%2Cgreeting_rank2_e%2Cgreeting_rank1_g%2Cmr01%2Cgreeting_recall3_j%2Cgreeting_recall1_d%2Cgreeting_recall2_i%2Ccontent_c%2Ccategory_lib_b_1%2Clist_online&e=550d982b4308c2b198473aa519503fa1&stype=2',
					cover: 'https://cdn.01lb.com.cn/images/nest/a_100507966_m_601_m6_260_360.webp',
					week: [1, 4],
					num: 274,
					total: 280,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '万界至尊',
					link:
						'https://www.iqiyi.com/v_1837rw5g03s.html?vfrm=category_lib.4&vfrmblk=S:lib_1_video&vfrmrst=S:lib_1_video_float_video_area11&bkt=list_main%2Cgreeting_rank3_c%2Cfilter_d%2Cgreeting_rank4_e%2Ccategory_page_01%2Cgreeting_rank2_e%2Cgreeting_rank1_g%2Cmr01%2Cgreeting_recall3_j%2Cgreeting_recall1_d%2Cgreeting_recall2_i%2Ccontent_c%2Ccategory_lib_b_1%2Clist_online&e=d06d983469196f5398378658f8975dab&stype=2&c1=%E5%8A%A8%E6%BC%AB',
					cover: 'https://cdn.01lb.com.cn/images/nest/a_100522203_m_601_m15_579_772.avif',
					week: [4, 0],
					num: 201,
					total: 230,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '诛仙',
					link: 'https://v.qq.com/x/cover/mzc00200z195unq/m4101tuq89d.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200z195unq1749694262811/350?imageView2/2/w/223/h/313',
					week: [4],
					num: 8,
					total: 26,
					date: '2025/07/23'
				},
				{
					type: 1,
					title: '龙族 第2季',
					link: 'https://v.qq.com/x/cover/mzc002008260hny/d4101k549xh.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc002008260hny1752913166512/350?imageView2/2/w/223/h/313',
					week: [5],
					num: 3,
					total: 24,
					date: '2025/07/23'
				},
				{
					type: 1,
					title: '苍兰诀 第2季',
					link: 'https://www.iqiyi.com/v_w3afcc4qeo.html',
					cover: 'https://cdn.01lb.com.cn/images/nest/a_100608663_m_601_m4_318_424.avif',
					week: [5],
					num: 3,
					total: 26,
					date: '2025/07/23'
				},
				{
					type: 1,
					title: '万界仙踪',
					link: 'https://v.qq.com/x/cover/5cuf8ahvxvm2587.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/5cuf8ahvxvm25871624273202279/350?max_age=7776001',
					week: [1, 4],
					num: 419,
					total: 464,
					date: '2024/01/28'
				},
				{
					type: 1,
					title: '真武巅峰',
					link:
						'https://v.youku.com/v_nextstage/id_fcae06d654bd4a15b269.html?spm=a2hja.12701310.filter.43&s=fcae06d654bd4a15b269',
					cover:
						'http://m.ykimg.com/05840000646B19E02052EE0B6CDC0F61?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [3, 6],
					num: 129,
					total: 196,
					date: '2024/04/05'
				},
				{
					type: 1,
					title: '逆天至尊',
					link: 'https://v.qq.com/x/cover/mzc00200azkttu2.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200azkttu21691465661315/350?max_age=7776001',
					week: [1, 5],
					num: 394,
					total: 480,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '独步逍遥',
					link: 'https://v.qq.com/x/cover/mzc00200qqsk3cv.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200qqsk3cv1691464821337/350?max_age=7776001',
					week: [1, 4],
					num: 355,
					total: 480,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '斗破苍穹年番',
					link: 'https://v.qq.com/x/cover/mzc0020027yzd9e.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc0020027yzd9e1691481451817/350?max_age=7776001',
					week: [0],
					num: 138,
					total: 209,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '完美世界',
					link: 'https://v.qq.com/x/cover/mcv8hkc8zk8lnov.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mcv8hkc8zk8lnov1691482685031/350?max_age=7776001',
					week: [5],
					num: 132,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '炼气十万年',
					link: 'https://v.qq.com/x/cover/mzc002006n62s11.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc002006n62s111691466247384/350?max_age=7776001',
					week: [2, 6],
					num: 224,
					date: '2025/3/21'
				},
				{
					type: 1,
					title: '武神主宰',
					link: 'https://v.qq.com/x/cover/7q544xyrava3vxf.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/7q544xyrava3vxf1610952810187/350?max_age=7776001',
					week: [2, 0],
					num: 530,
					total: 608,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '神印王座',
					link: 'https://v.qq.com/x/cover/mzc002007j7p5hn.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc002007j7p5hn1691555006651/350?max_age=7776001',
					week: [4],
					num: 76,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '遮天',
					link: 'https://v.qq.com/x/cover/mzc00200n53vkqc.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200n53vkqc1691482616829/350?max_age=7776001',
					week: [3],
					num: 26,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '万界独尊',
					link: 'https://v.qq.com/x/cover/mzc00200cu8uq8c.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200cu8uq8c1660030766362/350?max_age=7776001',
					week: [2, 6],
					num: 313,
					total: 386,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '星辰变 第6季',
					link: 'https://v.qq.com/x/cover/mzc002006wuirfi/a41007w0dd0.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc002006wuirfi1738151360181/0?max_age=7776000',
					week: [3],
					num: 28,
					total: 28,
					date: '2025/06/06'
				},
				{
					type: 1,
					title: '吞天记',
					link: 'https://v.qq.com/x/cover/mzc00200t39giu5/s4101al7xze.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc00200t39giu51747571393446/350?imageView2/2/w/223/h/313',
					week: [1, 3],
					num: 28,
					total: 40,
					date: '2025/07/23'
				},
				{
					type: 1,
					title: '宗门里除了我都是卧底',
					link: 'https://www.bilibili.com/bangumi/play/ss48518?from_spmid=666.16.0.0',
					cover:
						'https://cdn.01lb.com.cn/images/activity/7a72973b174b473850556d4b6402a13db679f7b8.png@320w_428h.webp',
					week: [1, 6],
					num: 50,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '我能无限顿悟',
					link:
						'https://www.iqiyi.com/tvg/to_page_url?album_id=MjMyMTE2NzE1MTE2MzkwMQ%3D%3D&app_version=13.032.21424&ext_params=rseat%3Darea_6%26rpage%3Dcategory_lib.4%26block%3Dpca_list_perview%26position%3D1%26hoverBlock%3Dpca_list_perview%26bstp%3D18%26bkt%3Dlist_main%2Cgreeting_pcw1_c%2Clist_online%26e%3Dce8d983776ada35e78a6630e1f8e849b%26vfrm%3Dcategory_lib.4%26vfrmblk%3Dpca_list_perview%26vfrmrst%3Darea_6&on_record=1&timestamp=1742549654180&tv_id=NjgxNTcwMjM5ODA0MDUwMA%3D%3D&sign=3553BC46515C5B39EC3930818188085D',
					cover: 'https://cdn.01lb.com.cn/images/activity/a_100570416_m_601_m3_195_260.webp',
					week: [3, 6],
					num: 45,
					total: 52,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '灵剑尊',
					link: 'https://v.qq.com/x/cover/2w2legt0g8z26al.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/2w2legt0g8z26al1691461288646/350?max_age=7776001',
					week: [2, 5],
					num: 580,
					total: 660,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '无上神帝',
					link: 'https://v.qq.com/x/cover/mzc00200ilydv1a.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200ilydv1a1620815950817/350?max_age=7776001',
					week: [1, 5],
					num: 475,
					total: 520,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '西行纪年番',
					link: 'https://v.qq.com/x/cover/mzc00200ekm0uc8.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200ekm0uc81659888327693/350?max_age=7776001',
					week: [3],
					num: 14,
					total: 64,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '武映三千道',
					link: 'https://v.qq.com/x/cover/mzc0020097rnzcv.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc0020097rnzcv1693105251501/350?max_age=7776001',
					week: [6, 0],
					num: 28,
					total: 60,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '师兄啊师兄',
					link:
						'https://v.youku.com/v_nextstage/id_badbb5792f934ddb82fd.html?spm=a2hja.12701310.filter.31&s=badbb5792f934ddb82fd',
					cover:
						'http://m.ykimg.com/058400006524BCC5142722186CBB28F9?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [4],
					num: 92,
					date: '2025/06/06'
				},
				{
					type: 1,
					title: '沧元图',
					link:
						'https://v.youku.com/v_nextstage/id_adaec02f09f9469ab8d8.html?spm=a2hja.12701310.filter.29&s=adaec02f09f9469ab8d8',
					cover:
						'http://m.ykimg.com/05840000649CF0D213EB660BA5BC4C95?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [6],
					num: 47,
					total: 57,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '九天玄帝诀',
					link:
						'https://v.youku.com/v_nextstage/id_efcf7daa538f412e803d.html?spm=a2hja.12701310.filter.33&s=efcf7daa538f412e803d',
					cover:
						'http://m.ykimg.com/05840000644F1D2613EB660A6368F768?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [1, 5],
					num: 186,
					total: 248,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '百炼成神',
					link:
						'https://v.youku.com/v_nextstage/id_bdfd61c13f714ae5affc.html?spm=a2hja.12701310.filter.35&s=bdfd61c13f714ae5affc',
					cover:
						'http://m.ykimg.com/0584000063B68AB613EB6609A0A7BF95?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [5],
					num: 54,
					total: 105,
					date: '2023/12/10'
				},
				{
					type: 1,
					title: '少年歌行 海外仙山篇',
					link:
						'https://v.youku.com/v_show/id_XNjExMzk0MDg2OA==.html?spm=a2hja.12701310.filter.31&s=ebfdfe59c76b49fb9fbe',
					cover:
						'http://m.ykimg.com/058400006540B9FB13EB6611FB1A80E7?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [3],
					num: 3,
					total: 26,
					date: '2023/10/31'
				},
				{
					type: 1,
					title: '少年歌行之暗河传',
					link:
						'https://v.youku.com/v_nextstage/id_cbfde043899a40f7a9c1.html?spm=a2hja.12701310.filter.49&s=cbfde043899a40f7a9c1',
					cover:
						'http://m.ykimg.com/0584000064C9C01013EBC60BC6E609C5?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [3],
					num: 26,
					total: 26,
					date: '2023/10/31'
				},
				{
					type: 1,
					title: '剑来',
					link: 'https://v.qq.com/x/cover/mzc0020072zgk61/t4100wuibew.html',
					cover:
						'https://vcover-vt-pic.puui.qpic.cn/vcover_vt_pic/0/mzc0020072zgk611721874669799/350?imageView2/2/w/446/h/626',
					week: [4],
					num: 4,
					total: 26,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '成何体统',
					link:
						'https://www.iqiyi.com/tvg/to_page_url?album_id=MzM5ODQ3NTg4NDYyNDkwMQ%3D%3D&app_version=12.82.17830&ext_params=rseat%3Darea_2%26rpage%3Dcategory_lib.4%26block%3Dpca_list_perview%26position%3D1%26hoverBlock%3Dpca_list_perview%26bstp%3D18%26bkt%3Dlist_main%2Cgreeting_pcw1_c%2Clist_online%26e%3D0d5d98e3fd5daae1f3e1e4c44986a129%26vfrm%3Dcategory_lib.4%26vfrmblk%3Dpca_list_perview%26vfrmrst%3Darea_2&on_record=1&timestamp=1724497588577&tv_id=NTY2MjE4NzkwODkxMDQwMA%3D%3D&sign=0C29A5B3AE02C6680976F1811858A3EE',
					cover: 'https://cdn.01lb.com.cn/images/activity/a_100534660_m_601_m8_318_424.webp',
					week: [5],
					num: 15,
					total: 24,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '神武天尊',
					link:
						'https://www.iqiyi.com/v_i5px6l860c.html?vfrmblk=pca_list_perview&bstp=18&e=0d5d98e3fd5daae1f3e1e4c44986a129&block=pca_list_perview&bkt=list_main,greeting_pcw1_c,list_online&rseat=area_5&rpage=category_lib.4&position=1&vfrm=category_lib.4&hoverBlock=pca_list_perview&vfrmrst=area_5',
					cover: 'https://cdn.01lb.com.cn/images/activity/a_100534689_m_601_m10_318_424.webp',
					week: [6],
					num: 7,
					total: 24,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '神墓',
					link:
						'https://v.youku.com/v_nextstage/id_fcaa728a97b5497a9175.html?spm=a2hja.12701310.filter.31&s=fcaa728a97b5497a9175',
					cover:
						'http://m.ykimg.com/0584000066B965E513EB6613584B0904?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [6],
					num: 20,
					total: 43,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '念无双',
					link:
						'https://www.iqiyi.com/v_1cjd7975090.html?vfrmblk=pca_list_perview&bstp=18&e=0d5d98e3fd5daae1f3e1e4c44986a129&block=pca_list_perview&bkt=list_main,greeting_pcw1_c,list_online&rseat=area_11&rpage=category_lib.4&position=1&vfrm=category_lib.4&hoverBlock=pca_list_perview&vfrmrst=area_11',
					cover: 'https://cdn.01lb.com.cn/images/activity/a_100534657_m_601_m13_318_424.webp',
					week: [3],
					num: 5,
					total: 14,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '永生',
					link: 'https://www.bilibili.com/bangumi/play/ss35213?from_spmid=666.16.0.0',
					cover:
						'https://cdn.01lb.com.cn/images/activity/67b6771db2da52956b08e5d869d91ce62497ac8f.png@320w_428h.webp',
					week: [5],
					num: 45,
					total: 56,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '赘婿2',
					link: 'https://www.bilibili.com/bangumi/play/ss47998?from_spmid=666.16.0.0',
					cover:
						'https://cdn.01lb.com.cn/images/activity/17742884b6a4999c8d2ceaccef59d9691156ce5c.png@330w_442h.webp',
					week: [5],
					num: 5,
					total: 16,
					date: '2024/08/24'
				},
				{
					type: 1,
					title: '盖世帝尊',
					link:
						'https://v.youku.com/v_nextstage/id_cedc44d365bd407cb7fb.html?spm=a2hja.12701310.filter.65&s=cedc44d365bd407cb7fb',
					cover:
						'http://m.ykimg.com/0584000064C5C41620148E0D509CEC15?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [4, 0],
					num: 24,
					total: 52,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '大主宰年番',
					link:
						'https://www.iqiyi.com/v_1d74ab0t9ug.html?vfrm=category_lib.4&vfrmblk=S:lib_1_video&vfrmrst=S:lib_1_video_float_video_area6&bkt=list_main%2Cgreeting_rank3_c%2Cfilter_d%2Cgreeting_rank4_e%2Ccategory_page_01%2Cgreeting_rank2_e%2Cgreeting_rank1_g%2Cmr01%2Cgreeting_recall3_j%2Cgreeting_recall1_d%2Cgreeting_recall2_i%2Ccontent_c%2Ccategory_lib_b_1%2Clist_online&e=550d982b4308c2b198473aa519503fa1&stype=2',
					cover: 'https://cdn.01lb.com.cn/images/nest/a_100459186_m_601_m13_260_360.avif',
					week: [5],
					num: 18,
					total: 52,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '青莲剑仙传',
					link:
						'https://www.iqiyi.com/v_lspcto5m7w.html?vfrm=category_lib.4&vfrmblk=S:lib_1_video&vfrmrst=S:lib_1_video_float_video_area12&bkt=list_main%2Cgreeting_rank3_c%2Cfilter_d%2Cgreeting_rank4_e%2Ccategory_page_01%2Cgreeting_rank2_e%2Cgreeting_rank1_g%2Cmr01%2Cgreeting_recall3_j%2Cgreeting_recall1_d%2Cgreeting_recall2_i%2Ccontent_c%2Ccategory_lib_b_1%2Clist_online&e=550d982b4308c2b198473aa519503fa1&stype=2',
					cover: 'https://cdn.01lb.com.cn/images/nest/a_100533209_m_601_m6_260_360.webp',
					week: [4, 0],
					num: 54,
					total: 54,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '王者大师兄',
					link: 'https://v.qq.com/x/cover/mzc00200g4s8kk0.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200g4s8kk01696041001740/350?max_age=7776001',
					week: [6],
					num: 8,
					total: 16,
					date: '2023/11/05'
				},
				{
					type: 1,
					title: '仙逆',
					link: 'https://v.qq.com/x/cover/mzc00200aaogpgh.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200aaogpgh1695600088596/350?max_age=7776001',
					week: [1],
					num: 5,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '恶魔法则',
					link: 'https://v.qq.com/x/cover/mzc00200ddf1a1w.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200ddf1a1w1697019179071/350?max_age=7776001',
					week: [5],
					num: 5,
					total: 24,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '修罗武神',
					link: 'https://v.qq.com/x/cover/mzc00200wuq8f4x.html',
					cover:
						'https://puui.qpic.cn/vcover_vt_pic/0/mzc00200wuq8f4x1695693043204/350?max_age=7776001',
					week: [2],
					num: 4,
					total: 16,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '仙武传',
					link:
						'https://v.youku.com/v_nextstage/id_fabd799ef8f546219853.html?spm=a2hja.12701310.filter.33&s=fabd799ef8f546219853',
					cover:
						'http://m.ykimg.com/05840000650F97FF13EBC60CD5B751CD?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [0],
					num: 105,
					date: '2025/03/21'
				},
				{
					type: 1,
					title: '万古狂帝',
					link:
						'https://v.youku.com/v_nextstage/id_adcaaeeca68042c28c7c.html?spm=a2hja.12701310.filter.320&s=adcaaeeca68042c28c7c',
					cover:
						'http://m.ykimg.com/05840000650427C413EB66D018A8B688?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [1],
					num: 10,
					total: 20,
					date: '2024/03/03'
				},
				{
					type: 1,
					title: '独步万古',
					link:
						'https://v.youku.com/v_nextstage/id_fafe8a23507c42a589ae.html?spm=a2hja.12701310.filter.57&s=fafe8a23507c42a589ae',
					cover:
						'http://m.ykimg.com/0584000064F593AEC847B70CD57F7097?x-oss-process=image/resize,w_315/interlace,1/quality,Q_80',
					week: [2, 5],
					num: 7,
					total: 130,
					date: '2023/10/15'
				},
				{
					type: 1,
					title: '逆天邪神',
					link:
						'https://www.iqiyi.com/v_o5999g9dp0.html?vfrm=category_lib.4&vfrmblk=S:lib_1_video&vfrmrst=S:lib_1_video_float_video_area2&bkt=list_main%2Cgreeting_rank3_c%2Cfilter_d%2Cgreeting_rank4_e%2Ccategory_page_01%2Cgreeting_rank2_e%2Cgreeting_rank1_g%2Cmr01%2Cgreeting_recall3_j%2Cgreeting_recall1_d%2Cgreeting_recall2_i%2Ccontent_c%2Ccategory_lib_b_1%2Clist_online&e=eabd9832d8501787f57158c09d8db54d&stype=2',
					cover: 'https://cdn.01lb.com.cn/images/nest/a_100459187_m_601_m9_260_360.avif',
					week: [6],
					num: 6,
					total: 30,
					date: '2023/10/15'
				}
			],
			list: []
		};
	},

	filters: {
		getZhWeek(week) {
			let arr = week.join('、');

			// 创建星期名称数组，下标对应星期数字
			let weekNames = ['日', '一', '二', '三', '四', '五', '六'];

			// 使用正则表达式进行替换
			arr = arr.replace(/[\d]/g, function(match) {
				return weekNames[parseInt(match)];
			});
			return arr;
		}
	},

	created() {
		this.initList();
	},

	methods: {
		initList() {
			let tabs = this.tabs;
			let types = tabs.map(k => k.type);
			let indexs = {};
			let day = new Date().getDay();

			types.forEach(t => {
				indexs[t] = tabs.findIndex(k => k.type === t);
			});

			this.cartoos.forEach(k => {
				const week = k.week.length === 1 ? k.week[0] : k.week[0] >= day ? k.week[0] : k.week[1];
				k.num = this.getNum(k);
				k.time = day > week ? week - day + 7 : week - day;
				tabs[0].total += 1;
				tabs[indexs[k.type]].total += 1;
			});
			this.cartoos
				.sort((a, b) => (a.time > b.time ? -1 : 1))
				.sort(k => (k.num === k.total ? 1 : -1))
				.sort(k => (k.num % 5 === 0 && k.num !== k.total ? -1 : 1));

			this.list = this.cartoos;
		},

		// 切换类目
		changeTab(name = '全部') {
			this.list = this.filterList(name);
		},

		// 获取集数
		// getNum(data) {
		// 	let num = data.num;

		// 	if (num >= data.total) {
		// 		return data.total;
		// 	}

		// 	let od = 1000 * 60 * 60 * 24, // 一天的时间戳
		// 		ts = new Date() - new Date(data.date), // 与初始日期相差的时间戳
		// 		bwd = new Date(data.date).getDay() || 7, // 初始的星期
		// 		cwd = new Date().getDay() || 7; // 当前的星期
		// 	let day = ts - od > 1 ? parseInt(ts / od) - 1 : 0, // 相差的天数
		// 		week = parseInt(day / 7); // 相差的星期数
		// 	let addNum = 0;

		// 	if (day % 7) {
		// 		data.week.forEach(k => {
		// 			k = k || 7;
		// 			// if (k !== bwd && k > bwd && bwd + (day % 7) >= k) addNum++;
		// 			if ((bwd > k || cwd < bwd) && cwd >= k) addNum++;
		// 		});
		// 	}

		// 	num += data.week.length * week + addNum;

		// 	return num >= data.total ? data.total : num;
		// },

		getNum(data) {
			if (data.num >= data.total) {
				return data.total;
			}

			const ONE_DAY = 1000 * 60 * 60 * 24;
			const startDate = new Date(data.date);
			const today = new Date();

			// 设置时间为当天的 00:00:00
			startDate.setHours(0, 0, 0, 0);
			today.setHours(0, 0, 0, 0);

			// 计算从开始日期到今天的天数差
			const diffDays = Math.floor((today - startDate) / ONE_DAY);

			if (diffDays < 0) {
				return data.num;
			}

			const weeks = Math.floor(diffDays / 7);
			const remainDays = diffDays % 7;
			const weeklyEpisodes = data.week.length;
			let totalNum = data.num + weeks * weeklyEpisodes;

			if (remainDays > 0) {
				// 改为大于0，不包含当天
				const startDayOfWeek = startDate.getDay();
				const updateDays = data.week.map(day => (day === 0 ? 7 : day));

				// 只检查从开始日期后一天到今天的更新
				for (let i = 1; i <= remainDays; i++) {
					const checkDay = (startDayOfWeek + i) % 7;
					const normalizedCheckDay = checkDay === 0 ? 7 : checkDay;
					if (updateDays.includes(normalizedCheckDay)) {
						totalNum++;
					}
				}
			}

			return data.total && totalNum >= data.total ? data.total : totalNum;
		},

		// 筛选动画类型
		filterList(name) {
			let list = [];

			if (name === '全部') {
				list = this.cartoos;
			} else {
				let type = this.tabs.find(k => k.title === name).type;
				list = this.cartoos.filter(k => k.type === type);
			}
			return list;
		},

		// i跳转打开链接
		jumpLink(href) {
			window.open(href);
		}
	}
};
</script>

<style lang="less" scoped>
.cartoo-page {
	.cartoo-wrap {
		display: flex;
		flex-wrap: wrap;
		justify-content: start;

		height: 750px;
		padding: 0 10px;
		text-align: center;
		overflow-y: scroll;

		.cartoo-li {
			line-height: 20px;
			margin: 0 10px 10px 0;
			cursor: pointer;

			.cartoo-img {
				width: 150px;
				height: 200px;
				object-fit: cover;
			}
			.cartoo-title {
				width: 150px;
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
			}
		}
		.active {
			color: #1296db;
		}
	}
}
</style>
